<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@page import="cn.com.zal.cgweb.common.utils.TcCartUtil"%>
<%@page import="cn.com.zal.cgweb.common.utils.UserUtil"%>
<%@page import="javax.util.zs.StringUtil"%>
<%@page import="cn.com.zal.cgweb.pojo.TcUser"%>
<%
String pidStr = request.getParameter("pid");
String qtyStr = request.getParameter("qty");
long qty = (StringUtil.isPositiveInt(qtyStr)?Long.valueOf(qtyStr):0L);
long pid = (StringUtil.isPositiveInt(pidStr)?Long.valueOf(pidStr):0L);
TcUser curUser = UserUtil.getCurUserAndCheckIfLogined(request);
TcCartUtil.putSkuToCart(curUser.getUserId(),pid,qty);
%>
<%=TcCartUtil.getCartJSON(curUser) %>
